<%= form_for(@ad) do |f| %>
  <% if @ad.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@ad.errors.count, "erreur") %> trouvées</h2>

      <ul>
      <% @ad.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">
    <%= f.label :label %>
    <%= f.text_field :label %>
  </div>
  <div class="field">
    <%= f.label :description %>
    <%= f.text_area :description %>
  </div>
  <div class="field">
    <%= f.label :cost %>
    <%= f.text_field :cost %>
  </div>
  <div class="field">
    <%= f.label :city %>
    <%= f.text_field :city %>
  </div>
  <div class="field">
    <%= f.label :wish %>
    <%= f.text_field :wish %>
  </div>
  <div class="field">
    <%= f.label(:is_object) %>
    <%= f.check_box(:is_object) %>
  </div>
  <div class="field">
    <%= f.label(:is_service) %>
    <%= f.check_box(:is_service) %>
  </div>
  <div class="field">
    <%= f.label :picture %>
    <%= f.file_field :picture %>
  </div>
  <div class="field">
    <%= f.label :tags %>
    <%= f.text_area :tags %>
  </div>
  <div class="field">
    <%= f.label :board %>
    <%= f.select(:board, Board.all) %>
  </div>
  <div class="actions">
    <%= f.submit "Valider l'annonce" %>
  </div>
<% end %>
